<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('http://yoursite.com').hostname,
    root: '/',
    scheme: 'Gemini',
    version: '7.7.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="颓废了一个寒假,临末尾来搭一个Discuz+wordpress吧">
<meta property="og:type" content="article">
<meta property="og:title" content="一起来搭Discuz和wordpress吧">
<meta property="og:url" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/index.html">
<meta property="og:site_name" content="Kvrmnks&#96;s blog">
<meta property="og:description" content="颓废了一个寒假,临末尾来搭一个Discuz+wordpress吧">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/shell.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wmlogin.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/ippre.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/vmconfig1.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/vmconfig2.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/vmconfig3.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/ipconfig4.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/firewall.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/httpdstatus.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/80.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzGet.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzInstall.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzInstall2.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzInstall3.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wordpressInstall1.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wordpressInstall2.png">
<meta property="og:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wordpressInstall3.png">
<meta property="article:published_time" content="2020-02-14T03:55:48.000Z">
<meta property="article:modified_time" content="2020-02-14T07:06:13.338Z">
<meta property="article:author" content="Kvrmnks">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/shell.png">

<link rel="canonical" href="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>一起来搭Discuz和wordpress吧 | Kvrmnks`s blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Kvrmnks`s blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">power overwhelming</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.jpg">
      <meta itemprop="name" content="Kvrmnks">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Kvrmnks`s blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          一起来搭Discuz和wordpress吧
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-02-14 11:55:48 / 修改时间：15:06:13" itemprop="dateCreated datePublished" datetime="2020-02-14T11:55:48+08:00">2020-02-14</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>颓废了一个寒假,临末尾来搭一个Discuz+wordpress吧<br><a id="more"></a></p>
<h3 id="环境"><a href="#环境" class="headerlink" title="环境"></a>环境</h3><p>系统 centos 7 </p>
<p>虚拟机 Vmware</p>
<p>Discuz X3.4</p>
<p>数据库 </p>
<h3 id="一些linux指令简单介绍"><a href="#一些linux指令简单介绍" class="headerlink" title="一些linux指令简单介绍"></a>一些linux指令简单介绍</h3><h4 id="reboot"><a href="#reboot" class="headerlink" title="reboot"></a>reboot</h4><p>重启</p>
<h4 id="ll"><a href="#ll" class="headerlink" title="ll"></a>ll</h4><p>显示当前目录文件和文件夹</p>
<p>相当于windows下的dir</p>
<h4 id="cd"><a href="#cd" class="headerlink" title="cd"></a>cd</h4><p>后面加文件夹名可以跳转到相应的文件夹中</p>
<p>和windows上的cd一样</p>
<p>另外</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd ~</span><br></pre></td></tr></table></figure>
<p>是跳转到一开始的目录</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd ..</span><br></pre></td></tr></table></figure>
<p>是跳转到上一层</p>
<h4 id="vi"><a href="#vi" class="headerlink" title="vi"></a>vi</h4><p>vi是linux中自带的记事本,不过相比较windows强了不知道多少倍…</p>
<p>它的GUI版本是熟悉的vim哦~</p>
<p>后面加文件名就可以打开或者创建文件</p>
<p>打开之后,要点一下i键才可以正常的编辑,如果和我版本一样的额话,可以在屏幕左下角看到一个INSERT</p>
<p>如果要保存或者退出,需要先点一下Esc键,这时候左下角的INSERT就会消失</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">:wq</span><br></pre></td></tr></table></figure><br>就代表保存并退出</p>
<p>这个时候你输入的指令都会显示在屏幕的最下面</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">:q</span><br></pre></td></tr></table></figure><br>代表退出</p>
<h4 id="cp"><a href="#cp" class="headerlink" title="cp"></a>cp</h4><p>cp指令就是复制啦<br>它的用法是<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp -参数 你要复制的 你要复制到哪里</span><br></pre></td></tr></table></figure><br>现在只用到了一个参数</p>
<p>-r代表递归复制,简单来说就是复制文件夹</p>
<h3 id="windows下使用ssh"><a href="#windows下使用ssh" class="headerlink" title="windows下使用ssh"></a>windows下使用ssh</h3><p>右键点击屏幕左下角的windows标志</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/shell.png" alt></p>
<p>选择Windows PowerShell</p>
<p>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh 用户名@ip地址</span><br></pre></td></tr></table></figure>
<p>如果出现让你输yes/no就输yes</p>
<p>然后会让你输入密码</p>
<p>连接完之后你在PowerShell里输入什么,连接的电脑就会做什么了~</p>
<h3 id="安装Vmware"><a href="#安装Vmware" class="headerlink" title="安装Vmware"></a>安装Vmware</h3><p>这有啥好说的???</p>
<p>跳过</p>
<h3 id="安装centos系统"><a href="#安装centos系统" class="headerlink" title="安装centos系统"></a>安装centos系统</h3><p><del>这有啥好说的</del></p>
<p>一定要记好自己的密码,用户名默认是root</p>
<p>每次登录的时候都需要输入账号和密码</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wmlogin.png" alt></p>
<p>这里主要讲一下配置网络的细节吧</p>
<p>因为可以联网之后,就可以用ssh控制电脑了呢,就不用盯着虚拟机那个小框了呢~</p>
<p>先输入以下</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ip addr</span><br></pre></td></tr></table></figure>
<p>如果长成这样</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/ippre.png" alt></p>
<p>注意看红线下面没有出现ip地址,这个时候就要手动配置一下网络</p>
<p>打开虚拟机设置</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/vmconfig1.png" alt></p>
<p>调整成桥接模式</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/vmconfig2.png" alt></p>
<p>然后回到虚拟机,输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd &#x2F;etc&#x2F;sysconfig&#x2F;network-scripts</span><br></pre></td></tr></table></figure>
<p>再输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ll</span><br></pre></td></tr></table></figure></p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/vmconfig3.png" alt></p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi ifcfg-ens33</span><br></pre></td></tr></table></figure></p>
<p>编辑ifcfg-ens33文件</p>
<p>顺便一提</p>
<p>linux在输入文件名的时候是可以按Tab键自动补全的</p>
<p>如果你玩过minecraft的话会好理解的~</p>
<p><del>比windows高到不知道哪里去了</del></p>
<p>把<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ONBOOT&#x3D;no</span><br></pre></td></tr></table></figure><br>改成<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ONBOOT&#x3D;yes</span><br></pre></td></tr></table></figure><br>保存退出</p>
<p>重启一下虚拟机</p>
<p>再输入一下ip addr</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/ipconfig4.png" alt></p>
<p>现在那个红线上面的ip地址就是你的虚拟机ip地址</p>
<p>现在可以用ssh链接你的虚拟机了~~</p>
<h3 id="配置基本的环境"><a href="#配置基本的环境" class="headerlink" title="配置基本的环境"></a>配置基本的环境</h3><h4 id="在自己的电脑上安装git"><a href="#在自己的电脑上安装git" class="headerlink" title="在自己的电脑上安装git"></a>在自己的电脑上安装git</h4><p>由于这个可能不是太复杂就不展开说了</p>
<h4 id="关防火墙和SELinux"><a href="#关防火墙和SELinux" class="headerlink" title="关防火墙和SELinux"></a>关防火墙和SELinux</h4><p>先要把什么防火墙之类的东西全关掉,防火墙什么的最讨厌了呢~</p>
<p>顺便一提,如果你登录的不是root的话,所有指令最好都带一个sudo前缀,保证你有足够的权限</p>
<p>依次输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl stop firewalld</span><br></pre></td></tr></table></figure></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl disable firewalld</span><br></pre></td></tr></table></figure>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/firewall.png" alt></p>
<p>这样就把防火墙关掉了~</p>
<p>但是linux还有个叫SELinux的讨厌的东西</p>
<p>编辑/etc/selinux/config文件</p>
<p>再顺便一提,右键powershell就可以粘贴哦~</p>
<p>把对应的一行改成这个<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">SELINUX&#x3D;disabled</span><br></pre></td></tr></table></figure><br>保存退出</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">setenforce 0</span><br></pre></td></tr></table></figure></p>
<p>在输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">getenforce</span><br></pre></td></tr></table></figure><br>如果显示Disabled就已经关掉了</p>
<p>如果不行就重启一下虚拟机吧~</p>
<h4 id="安装Apache"><a href="#安装Apache" class="headerlink" title="安装Apache"></a>安装Apache</h4><p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y install httpd</span><br></pre></td></tr></table></figure><br>其中它让输yes就输</p>
<p>安装完成后</p>
<p>依次输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl start httpd</span><br></pre></td></tr></table></figure><br>开启http<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl enable httpd</span><br></pre></td></tr></table></figure><br>设置http开机启动<br>可以输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl status httpd</span><br></pre></td></tr></table></figure><br><img src="一起来搭Discuz和wordpress吧/httpdstatus.png" alt></p>
<p>如果那个running变成了dead,极大的可能是有东西占用了80端口,比如阿里云就会自带nginx占用掉80端口</p>
<p>这个时候,输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install net-tools</span><br></pre></td></tr></table></figure><br>中间可能要输入一次y</p>
<p>完成之后输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">netstat -tlnp|grep 80</span><br></pre></td></tr></table></figure><br><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/80.png" alt><br>看到有程序在占用80端口,从右边可以看到进程号为1372,应用是httpd</p>
<p>这个地方由于我已经成功启动了httpd所以显示的是httpd,如果是什么其他的东西,就需要强行把这个应用停止,把80端口让给httpd<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kill -9 进程号</span><br></pre></td></tr></table></figure><br>直到80端口不再被占用</p>
<p>这时候<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl restart httpd</span><br></pre></td></tr></table></figure><br>重启一下httpd</p>
<h4 id="安装Mariadb"><a href="#安装Mariadb" class="headerlink" title="安装Mariadb"></a>安装Mariadb</h4><p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y install mariadb-server.x86_64</span><br></pre></td></tr></table></figure></p>
<p>顺便一提 Mariadb 是类似mysql开源版本的存在</p>
<p>默认的用户名是root</p>
<p>密码是空的</p>
<p>选它主要原因是开源(<del>国内下载的快</del>)</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl start mariadb</span><br></pre></td></tr></table></figure><br>开启服务</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl enable mariadb</span><br></pre></td></tr></table></figure>
<p>设置开机启动</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl status mariadb</span><br></pre></td></tr></table></figure>
<p>查看状态</p>
<h4 id="安装php和php-mysql"><a href="#安装php和php-mysql" class="headerlink" title="安装php和php-mysql"></a>安装php和php-mysql</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y install php php-mysql</span><br></pre></td></tr></table></figure>
<h4 id="安装git"><a href="#安装git" class="headerlink" title="安装git"></a>安装git</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install git -y</span><br></pre></td></tr></table></figure>
<h3 id="安装Discuz"><a href="#安装Discuz" class="headerlink" title="安装Discuz"></a>安装Discuz</h3><p>我们用git把Discuz的文件下载下来</p>
<p>Discuz的项目地址在</p>
<p><a href="https://gitee.com/ComsenzDiscuz/DiscuzX" target="_blank" rel="noopener">https://gitee.com/ComsenzDiscuz/DiscuzX</a></p>
<p>还好不在github…</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzGet.png" alt></p>
<p>一次点击克隆,复制</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone 你复制到的东西</span><br></pre></td></tr></table></figure></p>
<p>回到主目录,输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ll</span><br></pre></td></tr></table></figure></p>
<p>就能看到一个叫DiscuzX的文件夹,<del>当然你有可能看不出它是文件还是文件夹</del></p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp -r DiscuzX&#x2F;upload &#x2F;var&#x2F;www&#x2F;html&#x2F;upload</span><br></pre></td></tr></table></figure><br>把DiscuzX下的upload文件夹复制到那个奇怪的目录下</p>
<p>那个目录下的东西会被Apache(httpd)给解析成我们熟悉的网页</p>
<p>现在需要给DiscuzX一点权限<br>依次输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chmod -Rf 777 &#x2F;var&#x2F;www&#x2F;html&#x2F;</span><br></pre></td></tr></table></figure></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chmod -Rf 777 &#x2F;var&#x2F;www&#x2F;html&#x2F;upload</span><br></pre></td></tr></table></figure>
<p>打开浏览器,输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">虚拟机的ip地址&#x2F;upload</span><br></pre></td></tr></table></figure><br><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzInstall.png" alt></p>
<p>点我同意</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzInstall2.png" alt></p>
<p>点下一步*2</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/DiscuzInstall3.png" alt></p>
<p>数据库密码调成空(如果你没有手动调整数据库密码的话)</p>
<p>记得填写管理员密码哦~</p>
<p>然后就安完了~</p>
<h3 id="安装wordpress"><a href="#安装wordpress" class="headerlink" title="安装wordpress"></a>安装wordpress</h3><p>先要整到wordpress的安装包</p>
<p>最近的官网不大友好…</p>
<p>而且由于centos7默认的php的版本太低了也不能装版本过高的wordpress</p>
<p>所以我选了wordpress-v5.0.2-zh_CN.zip</p>
<p>现在要用ssh把这个zip传到虚拟机上</p>
<p>我把这个zip放在了e盘</p>
<p>我用了git带的scp</p>
<p>在e盘右键点击git bush here</p>
<p>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">scp wordpress-v5.0.2-zh_CN.zip root@192.168.0.107:wordpress-v5.0.2-zh_CN.zip</span><br></pre></td></tr></table></figure>
<p>在powershell输入ll就能看到传上去的文件了</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y unzip zip</span><br></pre></td></tr></table></figure><br>安装unzip</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">unzip wordpress-v5.0.2-zh_CN.zip</span><br></pre></td></tr></table></figure><br>解压这个zip包</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp -r wordpress &#x2F;var&#x2F;www&#x2F;html&#x2F;wordpress</span><br></pre></td></tr></table></figure></p>
<p>在浏览器输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http:&#x2F;&#x2F;ip地址&#x2F;wordpress</span><br></pre></td></tr></table></figure><br>就能看到wordpress的安装界面了~</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wordpressInstall1.png" alt></p>
<p>先别急着往下,现在我们要配置一下数据库</p>
<p>回到powershell</p>
<p>依次输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -uroot</span><br></pre></td></tr></table></figure><br>打开数据库<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">create database wordpress;</span><br></pre></td></tr></table></figure><br>建立要用的数据库<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">GRANT ALL ON wordpress.* TO &#39;wordpressuser&#39;@&#39;%&#39; IDENTIFIED BY &quot;123456&quot;;</span><br></pre></td></tr></table></figure><br>建立该数据库的账户,最后一个双引号换成你要的密码</p>
<p>我这里用的123456</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">quit</span><br></pre></td></tr></table></figure>
<p>退出数据库</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl restart mariadb</span><br></pre></td></tr></table></figure>
<p>重启一下数据库</p>
<p>回到浏览器</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wordpressInstall2.png" alt></p>
<p>依次填表</p>
<p>数据库主机填虚拟机的IP地址</p>
<p>如果你用的是阿里云之类的东西记得开放3306端口(数据库使用)</p>
<p>如果出现这个界面</p>
<p><img src="/2020/02/14/%E4%B8%80%E8%B5%B7%E6%9D%A5%E6%90%ADDiscuz%E5%92%8Cwordpress%E5%90%A7/wordpressInstall3.png" alt></p>
<p>回到powershell</p>
<p>输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vi &#x2F;var&#x2F;www&#x2F;html&#x2F;wordpress&#x2F;wp-config.php</span><br></pre></td></tr></table></figure><br>复制网页里的东西</p>
<p>粘贴(记得右键)</p>
<p>退出保存</p>
<p>然后回浏览器,一直往下走就好了~</p>
<p>之后有空再更新如何把wordpress调成多人模式吧~~</p>
<h3 id="参考网址"><a href="#参考网址" class="headerlink" title="参考网址"></a>参考网址</h3><p><a href="https://blog.csdn.net/xiehd313/article/details/80814584" target="_blank" rel="noopener">https://blog.csdn.net/xiehd313/article/details/80814584</a></p>
<p><a href="https://blog.51cto.com/2382492/2083079" target="_blank" rel="noopener">https://blog.51cto.com/2382492/2083079</a></p>
<p><a href="https://www.cnblogs.com/caicaizi/p/9564754.html" target="_blank" rel="noopener">https://www.cnblogs.com/caicaizi/p/9564754.html</a></p>
<p><a href="https://blog.csdn.net/sky101010ws/article/details/50782475" target="_blank" rel="noopener">https://blog.csdn.net/sky101010ws/article/details/50782475</a></p>
<p><a href="https://blog.csdn.net/weixin_42591732/article/details/102534262" target="_blank" rel="noopener">https://blog.csdn.net/weixin_42591732/article/details/102534262</a></p>
<p><a href="https://www.cnblogs.com/biaopei/p/11683407.html" target="_blank" rel="noopener">https://www.cnblogs.com/biaopei/p/11683407.html</a></p>
<p><a href="https://blog.csdn.net/weixin_42506905/article/details/90339253" target="_blank" rel="noopener">https://blog.csdn.net/weixin_42506905/article/details/90339253</a></p>
<p><a href="https://www.cnblogs.com/lywJ/p/10880332.html" target="_blank" rel="noopener">https://www.cnblogs.com/lywJ/p/10880332.html</a></p>
<p><a href="https://www.jianshu.com/p/ad58fd97119e" target="_blank" rel="noopener">https://www.jianshu.com/p/ad58fd97119e</a></p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/02/06/%E7%94%A8fft%E7%94%BB%E7%94%BB/" rel="prev" title="用fft画画">
      <i class="fa fa-chevron-left"></i> 用fft画画
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/02/16/codeforces-620/" rel="next" title="codeforces 620">
      codeforces 620 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#环境"><span class="nav-number">1.</span> <span class="nav-text">环境</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#一些linux指令简单介绍"><span class="nav-number">2.</span> <span class="nav-text">一些linux指令简单介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#reboot"><span class="nav-number">2.1.</span> <span class="nav-text">reboot</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#ll"><span class="nav-number">2.2.</span> <span class="nav-text">ll</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#cd"><span class="nav-number">2.3.</span> <span class="nav-text">cd</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#vi"><span class="nav-number">2.4.</span> <span class="nav-text">vi</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#cp"><span class="nav-number">2.5.</span> <span class="nav-text">cp</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#windows下使用ssh"><span class="nav-number">3.</span> <span class="nav-text">windows下使用ssh</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装Vmware"><span class="nav-number">4.</span> <span class="nav-text">安装Vmware</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装centos系统"><span class="nav-number">5.</span> <span class="nav-text">安装centos系统</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置基本的环境"><span class="nav-number">6.</span> <span class="nav-text">配置基本的环境</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#在自己的电脑上安装git"><span class="nav-number">6.1.</span> <span class="nav-text">在自己的电脑上安装git</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#关防火墙和SELinux"><span class="nav-number">6.2.</span> <span class="nav-text">关防火墙和SELinux</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装Apache"><span class="nav-number">6.3.</span> <span class="nav-text">安装Apache</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装Mariadb"><span class="nav-number">6.4.</span> <span class="nav-text">安装Mariadb</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装php和php-mysql"><span class="nav-number">6.5.</span> <span class="nav-text">安装php和php-mysql</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#安装git"><span class="nav-number">6.6.</span> <span class="nav-text">安装git</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装Discuz"><span class="nav-number">7.</span> <span class="nav-text">安装Discuz</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装wordpress"><span class="nav-number">8.</span> <span class="nav-text">安装wordpress</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考网址"><span class="nav-number">9.</span> <span class="nav-text">参考网址</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Kvrmnks"
      src="/images/head.jpg">
  <p class="site-author-name" itemprop="name">Kvrmnks</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">8</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/kvrmnks" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;kvrmnks" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="/1248669854" title="QQ → 1248669854"><i class="fa fa-fw fa-QQ"></i>QQ</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://i.icys.top/" title="https:&#x2F;&#x2F;i.icys.top&#x2F;" rel="noopener" target="_blank">icy</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Kvrmnks</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.7.0
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

  

</body>
</html>
